package com.jic.finance;

import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
import com.jic.common.swagger.config.Swagger2Config;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@EnableFeignClients(basePackages = {"com.jic.order.api"})
@EnableSwagger2
@MapperScan("com.jic.finance.mapper")
@EnableSwaggerBootstrapUI
@EnableDiscoveryClient
public class JicFinanceApplication {

    public static void main(String[] args) {
        SpringApplication.run(JicFinanceApplication.class, args);
    }

    @Bean
    @ConditionalOnMissingBean
    public Docket getDocket(){
        return new Swagger2Config().createRestApi(this.getClass().getSimpleName());
    }

}
